package com.ruoyi.draw.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.draw.mapper.NovelTagsMapper;
import com.ruoyi.draw.domain.NovelTags;
import com.ruoyi.draw.service.INovelTagsService;

/**
 * NovelTagsService业务层处理
 * 
 * @author Locke
 * @date 2025-10-25
 */
@Service
public class NovelTagsServiceImpl implements INovelTagsService 
{
    @Autowired
    private NovelTagsMapper novelTagsMapper;

    /**
     * 查询NovelTags
     * 
     * @param id NovelTags主键
     * @return NovelTags
     */
    @Override
    public NovelTags selectNovelTagsById(Long id)
    {
        return novelTagsMapper.selectNovelTagsById(id);
    }

    /**
     * 查询NovelTags列表
     * 
     * @param novelTags NovelTags
     * @return NovelTags
     */
    @Override
    public List<NovelTags> selectNovelTagsList(NovelTags novelTags)
    {
        return novelTagsMapper.selectNovelTagsList(novelTags);
    }

    /**
     * 新增NovelTags
     * 
     * @param novelTags NovelTags
     * @return 结果
     */
    @Override
    public int insertNovelTags(NovelTags novelTags)
    {
        novelTags.setId(System.currentTimeMillis());
        novelTags.setCreateBy(SecurityUtils.getUsername());
        novelTags.setCreateTime(DateUtils.getNowDate());
        return novelTagsMapper.insertNovelTags(novelTags);
    }

    /**
     * 修改NovelTags
     * 
     * @param novelTags NovelTags
     * @return 结果
     */
    @Override
    public int updateNovelTags(NovelTags novelTags)
    {
        novelTags.setUpdateBy(SecurityUtils.getUsername());
        novelTags.setUpdateTime(DateUtils.getNowDate());
        return novelTagsMapper.updateNovelTags(novelTags);
    }

    /**
     * 批量删除NovelTags
     * 
     * @param ids 需要删除的NovelTags主键
     * @return 结果
     */
    @Override
    public int deleteNovelTagsByIds(Long[] ids)
    {
        return novelTagsMapper.deleteNovelTagsByIds(ids);
    }

    /**
     * 删除NovelTags信息
     * 
     * @param id NovelTags主键
     * @return 结果
     */
    @Override
    public int deleteNovelTagsById(Long id)
    {
        return novelTagsMapper.deleteNovelTagsById(id);
    }
}
